<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/OrderStatus/orderStatusStep" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="orderStatusStep" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />
            <g:hiddenField name="docId1" value="${params.docId1}"/>
            <g:hiddenField name="state1" value="${params.state1}"/>
            <g:hiddenField name="partName1" value="${params.partName1}"/>
            <g:hiddenField name="lineNum1" value="${params.lineNum1}"/>
            <label >工序：</label>&nbsp;
        <g:select name="step" from="${orderStatusStepNameList}" data-toggle="selectpicker" data-live-search="true" optionKey="step" optionValue="step" value="${step}" noSelection="['':'ALL']" />&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/OrderStatus/exportOrderWaitStep?docId1=<%=params.docId1%>&state1=<%=params.state1%>&holdState1=<%=params.holdState1%>&lineNum=<%=params.lineNum%>')" data-icon="file-excel-o" title="导出Excel">导出</button>&nbsp;
        </div>
    </form>
</div>

<div class="panel-body">
    <div style="mini-width:400px;height:450px;" id="cellGlassOutputDiv"></div>
</div>

<div class="bjui-pageContent">
    <g:if test="${orderStatusStep.size() > 0}">
        <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr id="t1">
                <g:each in="${tableHeadList}" status="j" var="headInstance">
                    <g:if test="${headInstance!='RN'}">
                        <th  width="125"><g:message code="${headInstance}" default="${headInstance}"/></th>
                    </g:if>
                </g:each>
            </tr>
            </thead>
            <tbody>
            <g:if test="${orderStatusStep.size()>0}">
                <g:each in="${orderStatusStep}" status="i" var="dataInstance">
                    <tr>
                        <g:each in="${tableHeadList}" status="j" var="headInstance">
                            <g:if test="${headInstance=='MAIN_QTY'&&headInstance!='RN'}">
                                <td name="ORDERSTEPQTY${i}"><a href="${request.getContextPath()}/OrderStatus/OrderStatusStepTwo?docId2=<%=dataInstance.LINE_ID%>&partName2=<%=dataInstance.part_name%>&stepName2=<%=dataInstance.STEP_NAME%>&state2=<%=params.state1%>&lineNum2=<%=params.lineNum1%>&group3=<%=dataInstance.GROUP3%>" data-toggle="navtab"  data-id="dialog-normal" data-options="{id:'orderStatusAnalysisStepTwo', title:'订单状况分析表三级界面'}">${dataInstance["${headInstance}"]}</a></td>
                            </g:if>
                            <g:elseif test="${headInstance!='RN'}">
                                <td>${dataInstance["${headInstance}"]}</td>
                            </g:elseif>
                        </g:each>
                    </tr>
                </g:each>
                <tr>
                    <td colspan="6">小计(当前页)</td>
                    <td name="orderStepShow"></td>
                </tr>
                <tr>
                    <td colspan="6">合计(当前页)</td>
                    <td>${orderStatusStepSumQty.SUM_QTY[0]}</td>
                </tr>
            </g:if>
            <g:else>
                <g:render template="../template/emptyPanel" />
            </g:else>
            </tbody>
        </table>
    </g:if>
</div>
<g:render template="../template/51pagination" />
<script>
    $(function(){
        var orderStepQty=0;
        for(var i=0;i<${orderStatusStep.size()};i++){
            var stepqty='ORDERSTEPQTY'+i
            var orderQtyAdd=$("td[name='"+stepqty+"']").text()==''?0:parseInt($("td[name='"+stepqty+"']").text())
            orderStepQty+=orderQtyAdd


        }
        $("td[name='orderStepShow']").html(orderStepQty)

    })
</script>